<script>
$(document).ready(function() {
    $("#charge_supir").change(function(){
        $("#perusahaan").attr("value",(100-$("#charge_supir").attr("value")));
        });
    $("#perusahaan").change(function(){
        $("#charge_supir").attr("value",(100-$("#perusahaan").attr("value")));
});

} );
</script>
<?php
$data['cur_parent_menu']='master';
$data['cur_selected_menu']='prc';
$this->load->view('template/menu_view',$data);
?>
<br/><br/><br/><br />
<div class="gridcenter" style="font-family: 'open sans',arial,sans-serif;font-size: 18px;font-weight:bold;color:#666666;">Ubah Prosentase Charge</div>
<br />
<div class="demo_jui datagrid gridcenter">
<form method="post" action="<?php echo PRC ?>process_edit_prosentase_charge/<?php echo $id?>">
<table width="400">
	<tr>
		<td>
			Prosentase Sopir (%)
		</td>
		<td>
			: <input type="number" max="100" id="charge_supir" name="charge_supir" value="<?php echo $charge_supir ?>"/>
		</td>
	</tr>
	<tr>
		<td>
			Prosentase Perusahaan (%)
		</td>
		<td>
			: <input type="number" max="100" id="perusahaan" name="perusahaan" value="<?php echo $perusahaan ?>"/>
		</td>
	</tr>
        <tr>
		<td>
			Nama Cabang Asal :
		</td>
		<td>
			<?php
				for($i=0;$i<count($daftar_cabang);$i++){
					$opt[$daftar_cabang[$i]['Nama']] = $daftar_cabang[$i]['Nama'];
				}
				echo form_dropdown('asal', $opt,$asal);
			?>
		</td>
	</tr>
        <tr>
		<td>
			Nama Cabang Tujuan :
		</td>
		<td>
			<?php
				for($i=0;$i<count($daftar_cabang);$i++){
					$opt[$daftar_cabang[$i]['Nama']] = $daftar_cabang[$i]['Nama'];
				}
				echo form_dropdown('tujuan', $opt,$tujuan);
			?>
		</td>
	</tr>
	<tr>
		<td colspan="2">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="2">
			<input type="submit" value="Ubah"/>
		</td>
	</tr>
</table>
</form>
</div>